#ifndef Graphics_h
#define Graphics_h

#include "Engine.h"

// Common Graphics Error.
enum GraphicsError
{
    ERROR_NO,
    ERROR_COMPILE_SHADER,
    ERROR_LINK_SHADER
};

// The vertex attribute.
enum VertexAttribute
{
    ATTRIB_POSITION,
    ATTRIB_TEXCOORD,
    ATTRIB_NORMAL,
    ATTRIB_COLOR
};

// static class uniform
namespace Uniforms
{
	extern GLuint program;     
	extern GLuint programCube;  


    extern GLint uWvpMatrix;
	extern GLint uSampler;	
   

	extern GLint uCubeMVPMatrix;   
	extern GLint uCubeSampler;
};

// The Graphics Class.
class Graphics
{

private:
	static Graphics* graphics;
	virtual GLuint CompileShader(const char *source, int type);
	virtual GLuint LoadProgram(char fileVShader[], char fileFShader[]);

public:

	

	static Graphics* GetGraphics();

    Graphics();
    virtual ~Graphics();    
    void InitGraphics(); // return error Code.   
	void LoadShader();
	void SetProgram ( int program );
};

#endif
